<template>
  <view v-if="state && state.equipId">
    <SleepReportModel v-if="state.type === 11" :equipId="state.equipId" />
    <SugarReportModel v-if="state.type === 12" :equipId="state.equipId" />
    <PressureReportModel v-if="state.type === 13" :equipId="state.equipId" />
    <ExamineRecordModel v-if="state.type === 17" :equipId="state.equipId" />
  </view>
</template>

<script setup lang="ts">
import SleepReportModel from '@/subcontract/equipment/checkReport/component/sleepReportModel/index.vue';
import PressureReportModel from '@/subcontract/equipment/checkReport/component/pressureReportModel/index.vue';
import SugarReportModel from '@/subcontract/equipment/checkReport/component/sugarReportModel/index.vue';
import ExamineRecordModel from '@/subcontract/equipment/checkReport/component/examineRecordModel/index.vue';
interface IState {
  type: number;
  equipId: number;
}

const state = reactive<IState>({ type: 0, equipId: 0 });

onLoad((options) => {
  if (!options) return;
  state.type = Number(options.type);
  state.equipId = Number(options.id);
});
</script>
